<template>
    <div class="wrapper">
        <!-- <div class="header">

        </div> -->
        <div class="body">
            <Table :indexTag="true" :list="list" :state="false" v-loading="loading" :total="total"
             @currentChange="currentChange"
             @sizeChange="handSize">
                <!-- <slot>
                     <el-table-column label="操作" align="center">
                        <template slot-scope="scope">
                            <el-button
                                size="mini"
                                type="primary"
                                @click="handleEdit(scope.row)">修改
                            </el-button>
                            <el-button
                                size="mini"
                                type="danger"
                                @click="handleDel(scope.row)">删除
                            </el-button>
                        </template>
                    </el-table-column>
                </slot> -->
            </Table>
        </div>
    </div>
</template>

<script>
import Table from '../../../components/Table';
import {dictionaryList} from '../../../api/setting'
export default {
    components:{
        Table
    },
    data () {
         return {
            list:{
                thead:[
                    {label:'权限名称',prop:"name",rowspan:1},
                    {label:'权限编码',prop:"code",rowspan:1},
                ],
                tbody:[]
            },
            loading:false,
            total:0,
            title:'新增',
            centerDialogVisible:false,
             addForm:{
                id:'',
                name:'',
                remark:''
            },
            rule:{
                id:[  { required: true, message: '请输入设备ID', trigger: 'blur' },],
                name:[  { required: true, message: '请输入设备别名', trigger: 'blur' },],
                remark:[  { required: true, message: '请输入备注', trigger: 'blur' },]
            },
            pageNum:1,
            pageSize:20

        }
    },
    mounted () {
        this.getList();
    },
    methods:{
        handSize (val) {
            this.pageNum = val;
            this.getList()
        },
        currentChange(val) {
            this.pageSize = val;
            this.getList()
        },
        getList () {
            let obj = {
                pageNum:this.pageNum,
                pageSize:this.pageSize
                
            }
            dictionaryList(obj).then(res=>{
                if(res.status == 200) {
                    this.total = res.data.total;
                    this.list.tbody = res.data.list;
                }
            })
        },
    }
}
</script>

<style lang="less" scoped>
    .wrapper{
        width: 100%;
         overflow: auto;
        // .header{
        //     height: 190px;
        //     margin-bottom: 25px;
        //     background-color: #fff;
        // }
        .body{
            width: 100%;
            height:500px ;
            overflow: auto;
            box-sizing: border-box;
            padding:10px 20px;
            background-color: #fff;
        }

    }
</style>